// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue';
import VueRouter from 'vue-router';
import VueResource from 'vue-resource';
import App from './App';
import goods from 'components/goods/goods';
import ratings from 'components/ratings/ratings';
import seller from 'components/seller/seller';

import 'common/stylus/index.styl'

Vue.use(VueRouter);
Vue.use(VueResource);

//定义路由
const routes = [
    {path: '/goods',component:goods},
    {path: '/ratings',component:ratings},
    {path: '/seller',component:seller}
];
//创建router实例
const router = new VueRouter({
    routes,
    linkActiveClass:'active'
});
//创建和挂载根实例
const app = new Vue({
    el: '#app',
    data:{
        eventHub:new Vue()
    },
    template: '<App/>',
    components: { App },
    router
}).$mount('#app');

//默认显示goods内容
//router.push('/goods')
